import request from '@/utils/request'

/**
 * @description 获取组织架构接口
 * @returns
 */
export const getDepartmentListApi = () => request({
  url: '/company/department'
})

/**
 * @description 获取员工简单列表接口
 * @returns
 */
export const getSimpleInfoApi = () => request({
  url: '/sys/user/simple'
})

/**
 * @description 新增部门
 * @param {*} data
 * @returns
 */
export const addDeptApi = (data) => request({
  url: '/company/department',
  method: 'POST',
  data
})

/**
 * @description 根据ID查询部门详情
 * @param {*} id
 * @returns
 */
export const reGetDeptListApi = (id) => request({
  url: `/company/department/${id}`
})

/**
 * @description 根据ID修改部门详情
 * @param {*} data
 * @returns
 */
export const editDeptApi = (data) => request({
  url: `/company/department/${data.id}`,
  method: 'PUT',
  data
})

export const delDeptApi = (id) => request({
  url: `/company/department/${id}`,
  method: 'DELETE'
})
